﻿<!--#include file="../Include/Config.asp"-->
<link rel="stylesheet" href="../Css/Admin.css" type="text/css" />
<script language="javascript" type="text/javascript">
function checkAll()
{
  var objForm = document.form1;
  var objLen = objForm.length;
  for (var elcount = 0; elcount < objLen; elcount++)
  {
    if (objForm.elements[elcount].type == "checkbox")
    {
      objForm.elements[elcount].checked = true;
    }
  }
}
function cancelAll()
{
  var objForm = document.form1;
  var objLen = objForm.length;
  for (var elcount = 0; elcount < objLen; elcount++)
  {
    if (objForm.elements[elcount].type == "checkbox")
    {
      objForm.elements[elcount].checked = 0;
    }
  }
}
</script>
<form name="form1" method="post" action="GuestBookDell.asp">
<div id="SuveyAdmin">
<table width="100%" align="center" cellpadding="0" cellspacing="0" id="SurveyAdmin" class="table">
<%
dim  sql,page_size,rscount,item_count,page_num,page_now,i
page_size=10
set rscount=conn.execute("select count(*) as item_count from guestbook")
	item_count=cint(rscount("item_count"))
	rscount.close
    page_num=item_count\page_size 
sql="select * from guestbook order by GB_date desc"
rs.CursorLocation = 3
rs.open sql,conn,1,3
if not rs.eof then
	rs.pagesize=page_size
	page_now=1
	if trim(request.QueryString("page"))<>"" then
	page_now=cint(trim(request.QueryString("page")))
	end if
	if page_now>rs.pagecount or page_now<0 then
	page_now=1
	end if
	rs.absolutepage=page_now
%>
<tr>
<th>留言者昵称</th>
<th>留言者QQ</th>
<th>留言者电话</th>
<th>留言者E-mail</th>
<th>留言时间</th>
<th>操作</th>
</tr>
<%
  i=1
  while not rs.eof and i<page_size+1
%>
<tr>
<td><%=rs("GB_user")%></td>
<td><%=rs("GB_qq")%></td>
<td><%=rs("GB_phone")%></td>
<td><a href="mailto:<%=rs("GB_email")%>"><%=rs("GB_email")%></a></td>
<td><%=rs("GB_date")%></td>
<td>
<a href="#" onClick="showModalDialog('GuestBookShow.asp?GB_id=<%=rs("GB_id")%>',window,'dialogHeight:450px;dialogWidth:560px;dialogleft:220px;help:no;status:no;scroll:no');">查看</a>|
&nbsp;<input type="checkbox" name="GB_id" value="<%=rs("GB_id")%>"></td>
</tr>
<%
   rs.movenext
   i=i+1
   wend
%>
<tr>
<td colspan="6" align="right">
<div id="bottom_pagebox" style="padding-right:25px;">
当前第<%=page_now%>页
  <%if page_now=1 then%>首页
  <%else%><a href="GuestBookList.asp?page=1">首页</a>
  <%end if%>
  <%if page_now>1 and rs.pagecount>1 then%>
  <a href="GuestBookList.asp?page=<%=page_now-1%>">上一页</a>
  <%else%>上一页
  <%end if%>				
  <%if page_now<rs.pagecount then%> 
  <a href="GuestBookList.asp?page=<%=page_now+1%>">下一页</a>
  <%else%>下一页
  <%end if%>				
  <%if page_now<>rs.pagecount then%> 
  <a href="GuestBookList.asp?page=<%=rs.pagecount%>">尾页</a>
  <%else%>尾页
  <%end if%>
  共<%=rs.pagecount%>页/<%=item_count%>篇</div></td>
</tr>
<tr>
<td colspan="6" align="right">
<div id="button">
  <input type="button" name="but1"  onclick="checkAll();" value="全选"/> 
  <input type="button" name="but2" onclick="cancelAll();" value="全不选"/> 
  <input type="button" name="submit1" value="删除" onclick="document.form1.submit();" >
</div>
</td>
</tr>
<%else%>
<tr>
<td colspan="6">暂时没有留言</a></td>
</tr>
<%
end if
rs.close
%>
</table>
</div>
</form>